package com.mxt.moviedemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class SuccessPageController {
    @GetMapping("/successPage")
    public String showSuccessPage(@RequestParam(name = "username", required = false) String username, Model model) {
        model.addAttribute("username", username);
        return "successPage";
    }
    @GetMapping("/adminSuccessPage")
    public String showAdminSuccessPage(@RequestParam(name = "username", required = false) String username,
                                       Model model) {
        model.addAttribute("username", username);
        return "adminPage";
    }
}